<template>
    <div class="cdetail">
        <navBar>
            课程详情
            <template #my>
              <span @click="show = true" >分享</span>
            </template>
        </navBar>
        <van-overlay :show="show" @click="show = false">
            <div class="wrapper">
                <div class="block" >
                <vue-qr :logoSrc="imageUrl" :text="url" :size="200" v-if="show" class="er"></vue-qr>
                </div>
            </div>
        </van-overlay>
        <itemryVue :courseList="courseList"></itemryVue>
        <div class="rw">
            <p>教学团队</p>
            <div>
                <div class="con" v-for="(ele,ind) in courseList.teachers" :key="ind">
                    <img :src="ele.avatar" alt="">
                    <span>{{ele.teacher_name}}</span>
                </div>
            </div>
        </div>
        <div class="js">
            <p>课程介绍</p>
            <span v-if="courseList.info">{{courseList.info.course_statement}}</span>
        </div>
        <div class="dg">
            <p>课程大纲</p>
        </div>
        <div class="pl">
            <p>课程评论</p>
            <img src="@/assets/images/empty.png" alt="">
        </div>
    </div>
</template>

<script>
import vueQr from 'vue-qr'
import itemryVue from '@/components/conten/itemry.vue'
import { getcourseInfo } from "@/http/banner"
export default {
    data() {
        return {
            imageUrl: "https://img01.yzcdn.cn/vant/logo.png",
            show: false,
            url: window.location.href,
            courseList: []
        }
    },
    mounted() {
        this.getcourseInfoList()
    },
    methods: {
        async getcourseInfoList() {
            let res = await getcourseInfo(this.$route.query.id)
            console.log(res);
            this.courseList = res.data
            console.log(this.courseList);
        }
    },
    components: {
        vueQr,
        itemryVue
    },
}
</script>

<style lang="scss" scoped>
.rw {
    background-color: #fff;
    line-height: 40px;
    margin-bottom: 15px;
    padding-left: 15px;

    >div {
        width: 90vw;
        margin-left: 5vw;
        display: flex;
        justify-content: space-around;
    }

    p {
        font-size: 16px;
    }

    .con {
        flex: 1;
        display: flex;
        flex-direction: column;
        font-size: 12px;
        background-color: #fff;

        img {
            width: 35px;
            height: 35px;
            border-radius: 50%;
        }
    }
}

.js {
    background-color: #fff;
    margin-bottom: 15px;
    line-height: 30px;
    padding-left: 15px;

    p {
        font-size: 16px;
    }

    span {
        font-size: 12px;
    }
}

.dg {
    padding-left: 15px;
    background-color: #fff;
    margin-bottom: 15px;
    line-height: 30px;

    p {
        font-size: 16px;
    }

    span {
        font-size: 12px;
    }
}

.pl {
    padding-left: 15px;
    background-color: #fff;
    margin-bottom: 15px;
    line-height: 30px;

    p {
        font-size: 16px;
    }

    img {
        width: 100px;
        height: 100px;
        margin-left: 120px;
    }
}

.wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.block {
    width: 120px;
    height: 120px;
    background-color: #fff;
}
</style>
